

function say() {
    alert("LC:645. Set Mismatch");
}
say();


/**
 * @param {number[]} nums
 * @return {number[]}
 */
var findErrorNums = function (nums) {
    // 10:41-56
    var dic = {}
    var repeat = -1
    for(var i = 0; i < nums.length; i++){
        if(!dic[nums[i]]) {
            dic[nums[i]] = 0
        }
        dic[nums[i]]++
    }

    
    var loss = -1
    for(var i = 1; i < nums.length + 1; i++){
        if(!dic[i]) {
            loss = i
        }
        else if(dic[i] == 2){
            repeat = i
        }
    }

    return [repeat, loss]
};
